<?php

namespace App\Http\Requests\Source\Rong360;

/*
 * 废弃
 */
class UserRequest extends Rong360Request
{
    /**
     * @var array 定义验证规则
     */
    private $rules = [
        'check'=>[
            'md5'=>'required|string',
            'user_name'=>'required|string',
            'product_id'=>'present'
        ],
    ];

    public function rules()
    {
        // 根据不同的请求, 添加不同的验证规则，将对应的请求的规则和公共的规则合并
        if (static::getPathInfo() == '/api/source/r360/user/check'&&static::getMethod()=='POST')
        {
            $this->useRules = array_merge($this->rules['check']);
        }
        return $this->useRules;
    }

    /**
     * Description:设置各个字段中文
     * Author: Sam
     * DateTime: 2019-02-22 11:34
     * @return array
     */
    public function attributes()
    {
        return [
            'md5'=>'md5值',
            'user_name '=>'用户姓名',
            'product_id'=>'产品id',
        ];
    }

}
